<template>
	<div>
		<ul>
			<li
				:key="index"
				@click="setName(value, $event)"
				v-for="(value, index) in list"
			>
				{{ value }}
			</li>
		</ul>

		<h1>{{ name }}</h1>
	</div>
</template>

<script>
export default {
	methods: {
		setName(name, event) {
			this.name = name
			console.log(event)
		},
	},
	data() {
		return {
			name: '',
			list: ['苹果', '香蕉', '西瓜'],
		}
	},
}
</script>
